package com.grad.webstudy.enums;

/**
 * @Description:
 * @Author: zjf
 * @Date: 2020/2/5 14:20.
 */
public enum ObjTypeEnums {

    USER(1, "用户"),
    COURSE(2, "课程");


    private int objType;
    private String desc;

    ObjTypeEnums(int objType, String desc) {
        this.objType = objType;
        this.desc = desc;
    }

    public int getObjType() {
        return objType;
    }

    public void setObjType(int objType) {
        this.objType = objType;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static String getDesc(Integer type) {
        for (ObjTypeEnums objTypeEnums : ObjTypeEnums.values()) {
            if (objTypeEnums.getObjType() == type) {
                return objTypeEnums.getDesc();
            }
        }
        return null;
    }
}
